<?php

class StdLibSettings implements CliLibrary
{
	private static $settings = array(
		'result_round' => 10,
		'angle' => 'rad',
	);

	public static function addLibrary (CliMode $mode)
	{
		$mode->addSettings(__CLASS__, self::$settings);
	}

	public static function validate_degree ($value)
	{
		if (!in_array($value, array('rad', 'deg')))
		{
			throw new CliArgumentException("Degree must be either 'rad' or 'deg'");
		}

		return $value;
	}
}

?>